package com.zj.android.adapter

import android.content.Context
import com.zj.android.BR
import com.zj.android.R
import com.zj.android.bean.ArticleItemBean
import com.zj.android.databinding.AdapterPagingBinding
import com.zj.common.adapter.BasePagingAdapter

class PagingAdapter : BasePagingAdapter<ArticleItemBean, AdapterPagingBinding>() {


    override fun getItemLayout(position: Int): Int {
        return R.layout.adapter_paging
    }

    override fun onBind(
        holder: BaseViewHolder<AdapterPagingBinding>,
        position: Int,
        binding: AdapterPagingBinding?,
        context: Context,
        payloads: MutableList<Any>?
    ) {
        binding?.setVariable(BR.paging_item, getItem(position))
        binding?.executePendingBindings()
        binding?.let {
            holder.addOnClickListener(it.img)
            holder.addOnClickListener(it.test)
        }

    }


}